package com.jerry.constellation.Utils;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class URLContent {
    //星座配对接口
    public static String getPartnerURL(String male, String female) {
        male = male.replace("座", "");
        female = female.replace("座", "");
        try {
            male = URLEncoder.encode(male, "UTF-8");
            female = URLEncoder.encode(female, "UTF-8");
        } catch (Exception e) {
            e.printStackTrace();
        }
        String url = "http://apis.juhe.cn/xzpd/query?men=" + male + "&women=" + female + "&key=c2a27b60ed9c407e4861d3371853676b";
        return url;
    }

    //星座运势接口
    public static String getLuckyURL(String name){
        try {
            name=URLEncoder.encode(name,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        String url="http://web.juhe.cn:8080/constellation/getAll?consName="+name+"&type=year&key=993fd751e3cd34ae6ae39911ab7af129";
        return url;
    }
}
